package com.regexs;

/**
 * @className: Test2
 * @description: TODO 类描述
 * @author: YUANG
 * @date: 2021/12/29
 **/
public class Test2 {
    public static void main(String[] args) {
        String regex1 = "^[1-9]\\d{10}$";
        System.out.println("01234567899".matches(regex1));
        System.out.println("112345678992".matches(regex1));
        System.out.println("----------------------------");
        String regex2 = "[0-9a-fA-F]{6}";
        System.out.println("1A2b3c".matches(regex2));
        System.out.println("1A2b3G".matches(regex2));
        System.out.println("----------------------------");
        String regex3 = "java|php";
        System.out.println("java".matches(regex3));
        System.out.println("php".matches(regex3));
        System.out.println("go".matches(regex3));
        System.out.println("----------------------------");
        String regex4 = "learn\\s(java|php)";
        System.out.println("learn java".matches(regex4));
        System.out.println("learn php".matches(regex4));
        System.out.println("learn go".matches(regex4));
        System.out.println("----------------------------");
        String regex5 = "^\\d\\d{2}";
        System.out.println("100".matches(regex5));
        System.out.println("a00 php".matches(regex5));
        System.out.println("----------------------------");
        String regex6 = "\\w*[a-z]$";
        System.out.println("100c".matches(regex6));
        System.out.println("a001 php".matches(regex6));


    }
}
